/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.openbrew.openbrewrf;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "Vendors")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Vendors.findAll", query = "SELECT v FROM Vendors v ORDER BY v.vName ASC"),
    @NamedQuery(name = "Vendors.findByVid", query = "SELECT v FROM Vendors v WHERE v.vid = :vid"),
    @NamedQuery(name = "Vendors.findByVName", query = "SELECT v FROM Vendors v WHERE v.vName = :vName"),
    @NamedQuery(name = "Vendors.findByVAddr", query = "SELECT v FROM Vendors v WHERE v.vAddr = :vAddr"),
    @NamedQuery(name = "Vendors.findByVCity", query = "SELECT v FROM Vendors v WHERE v.vCity = :vCity"),
    @NamedQuery(name = "Vendors.findByVState", query = "SELECT v FROM Vendors v WHERE v.vState = :vState"),
    @NamedQuery(name = "Vendors.findByVZip", query = "SELECT v FROM Vendors v WHERE v.vZip = :vZip"),
    @NamedQuery(name = "Vendors.findByVPhone", query = "SELECT v FROM Vendors v WHERE v.vPhone = :vPhone"),
    @NamedQuery(name = "Vendors.findByVEmail", query = "SELECT v FROM Vendors v WHERE v.vEmail = :vEmail"),
    @NamedQuery(name = "Vendors.findByVNotes", query = "SELECT v FROM Vendors v WHERE v.vNotes = :vNotes")})
public class Vendors implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "VID")
    private Integer vid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 50)
    @Column(name = "VName")
    private String vName;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 50)
    @Column(name = "VAddr")
    private String vAddr;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 30)
    @Column(name = "VCity")
    private String vCity;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 30)
    @Column(name = "VState")
    private String vState;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 30)
    @Column(name = "VZip")
    private String vZip;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 30)
    @Column(name = "VPhone")
    private String vPhone;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 100)
    @Column(name = "VEmail")
    private String vEmail;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 100)
    @Column(name = "VNotes")
    private String vNotes;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 400)
    @Column(name = "VEmailCC")
    private String vEmailCC;
    @OneToMany(mappedBy = "stockVendID")
    private Collection<StockCode> stockCodeCollection1;
    @OneToMany(mappedBy = "stockAltVendID")
    private Collection<StockCode> stockCodeCollection2;
    @OneToMany(mappedBy = "hopContractV1")
    private Collection<HopContract> hcCollection1;
    @OneToMany(mappedBy = "hopContractV2")
    private Collection<HopContract> hcCollection2;
    @OneToMany(mappedBy = "hopContractV3")
    private Collection<HopContract> hcCollection3;
    @OneToMany(mappedBy = "hopContractV4")
    private Collection<HopContract> hcCollection4;

    public Vendors() {
    }

    public Vendors(Integer vid) {
        this.vid = vid;
    }

    public Vendors(Integer vid, String vName, String vAddr, String vCity, String vState, String vZip, String vPhone, String vEmail, String vNotes, String vEmailCC) {
        this.vid = vid;
        this.vName = vName;
        this.vAddr = vAddr;
        this.vCity = vCity;
        this.vState = vState;
        this.vZip = vZip;
        this.vPhone = vPhone;
        this.vEmail = vEmail;
        this.vNotes = vNotes;
        this.vEmailCC = vEmailCC;
    }

    public Integer getVid() {
        return vid;
    }

    public void setVid(Integer vid) {
        this.vid = vid;
    }

    public String getVName() {
        return vName;
    }

    public void setVName(String vName) {
        this.vName = vName;
    }

    public String getVAddr() {
        return vAddr;
    }

    public void setVAddr(String vAddr) {
        this.vAddr = vAddr;
    }

    public String getVCity() {
        return vCity;
    }

    public void setVCity(String vCity) {
        this.vCity = vCity;
    }

    public String getVState() {
        return vState;
    }

    public void setVState(String vState) {
        this.vState = vState;
    }

    public String getVZip() {
        return vZip;
    }

    public void setVZip(String vZip) {
        this.vZip = vZip;
    }

    public String getVPhone() {
        return vPhone;
    }

    public void setVPhone(String vPhone) {
        this.vPhone = vPhone;
    }

    public String getVEmail() {
        return vEmail;
    }

    public void setVEmail(String vEmail) {
        this.vEmail = vEmail;
    }

    public String getVNotes() {
        return vNotes;
    }

    public void setVNotes(String vNotes) {
        this.vNotes = vNotes;
    }

    public String getVEmailCC() {
        return vEmailCC;
    }

    public void setVEmailCC(String vEmailCC) {
        this.vEmailCC = vEmailCC;
    }

    @XmlTransient
    public Collection<StockCode> getStockCodeCollection1() {
        return stockCodeCollection1;
    }

    public void setStockCodeCollection1(Collection<StockCode> stockCodeCollection1) {
        this.stockCodeCollection1 = stockCodeCollection1;
    }

    @XmlTransient
    public Collection<StockCode> getStockCodeCollection2() {
        return stockCodeCollection2;
    }

    public void setStockCodeCollection2(Collection<StockCode> stockCodeCollection2) {
        this.stockCodeCollection2 = stockCodeCollection2;
    }

    @XmlTransient
    public Collection<HopContract> getHCCollection1() {
        return hcCollection1;
    }

    public void setHCCollection1(Collection<HopContract> hcCollection1) {
        this.hcCollection1 = hcCollection1;
    }

    @XmlTransient
    public Collection<HopContract> getHCCollection2() {
        return hcCollection2;
    }

    public void setHCCollection2(Collection<HopContract> hcCollection2) {
        this.hcCollection2 = hcCollection2;
    }

    @XmlTransient
    public Collection<HopContract> getHCCollection3() {
        return hcCollection3;
    }

    public void setHCCollection3(Collection<HopContract> hcCollection3) {
        this.hcCollection3 = hcCollection3;
    }

    @XmlTransient
    public Collection<HopContract> getHCCollection4() {
        return hcCollection4;
    }

    public void setHCCollection4(Collection<HopContract> hcCollection4) {
        this.hcCollection4 = hcCollection4;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (vid != null ? vid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Vendors)) {
            return false;
        }
        Vendors other = (Vendors) object;
        if ((this.vid == null && other.vid != null) || (this.vid != null && !this.vid.equals(other.vid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.Vendors[ vid=" + vid + " ]";
    }
    
}
